﻿namespace EyeOpen.SilverlightDto.Service
{
	using System.Collections.Generic;
	using System.Linq;
	using System.ServiceModel;

	[ServiceContract]
	public class CustomerService
	{
		[OperationContract]
		public IEnumerable<CustomerDto> GetCustomerList()
		{
			return
				new CustomerRepository()
					.GetAll()
					.Select(c => 
						new CustomerDto
							{
								Id = c.Id, 
								FirstName = c.FirstName, 
								Age = c.Age, 
								City = c.City.Name
							});
		}
	}
}